var t = getApp(), e = t.requirejs("core");

Page({
    data: {
        bgColor: 'linear-gradient(to right, #ecbe85 0%, #ecbe85 100%)',
        backgroundImage: '',
        buttonColor:'',
        fontColorAssistant: '#be2521',
        fontColorHost: '#fff',
    },
    onLoad: function(w) {
        t.checkAuth();
        this.setData({
            options: w
        });
        e.post("goods.yyindex", {}, ((e) => {
            this.setData({
                lists: e.list
            })
        }))
    },
    onShow: function() {
        this.getData();
        this.getSysset();
    },
    getSysset() {
        var that = this
        e.post("index.get_sysset", {
            syssetType: 2
        }, ((e) => {
            let data = e.data
            if (data.backgroundImage) {
                that.data.backgroundImage = 'https://zzsl.sctqmt.com/attachment/' + data.backgroundImage
            } else {
                that.data.backgroundImage = ''
            }
            that.setData({
                // buttonColor: data.buttonColor,
                fontColorAssistant: data.fontColorAssistant,
                backgroundImage: that.data.backgroundImage,
                fontColorHost:data.fontColorHost,
            });
            console.log(data, '配置颜色', that.data)
        }))
    },
    getData: function() {
        var t = this;
        e.get("commission/index", {}, function(e) {
            7e4 != e.error ? (e.show = !0, t.setData(e), wx.setNavigationBarTitle({
                title: e.set.texts.center
            })) : wx.redirectTo({
                url: "../../commission/pages/register/index"
            });
        });
    },
    back() {
        wx.navigateBack({
          delta: 0,
        })
    },
});